home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 July: Mac OS SDK / Dev.CD Jul 96 SDK / Dev.CD Jul 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / Include / FWPrmise.h < prev    next >
Encoding:
Text File  |  1996-04-25  |  4.1 KB  |  143 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWPrmise.h
  4. //    Release Version:    $ ODF 1 $
  5. //
  6. //    Copyright:            (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWPRMISE_H
  11. #define FWPRMISE_H
  12.  
  13. #ifndef FWPRTDEF_H
  14. #include "FWPrtDef.h"
  15. #endif
  16.  
  17. // ----- Foundation Includes -----
  18.  
  19. #ifndef FWRUNTYP_H
  20. #include "FWRunTyp.h"
  21. #endif
  22.  
  23. #ifndef FWPRIDEB_H
  24. #include "FWPriDeb.h"
  25. #endif
  26.  
  27. // ----- OpenDoc Includes -----
  28.  
  29. #ifndef FWODTYPS_H
  30. #include "FWODTyps.h"
  31. #endif
  32.  
  33. //========================================================================================
  34. //    Forward Declarations
  35. //========================================================================================
  36.  
  37. class ODStorageUnitView;
  38. class ODStorageUnit;
  39.  
  40. class FW_CFrame;
  41. class FW_CPart;
  42. class FW_CSelection;
  43. class FW_CCloneInfo;
  44. class FW_CLinkSource;
  45. class FW_CDataInterchange;
  46.  
  47. //========================================================================================
  48. //    class FW_CPromise
  49. //========================================================================================
  50.  
  51. class FW_CPromise
  52. {
  53. //----------------------------------------------------------------------------------------
  54. //    Constructor/Destructor
  55. //
  56. public:
  57.     FW_CPromise(Environment*ev, 
  58.                 FW_EStorageKinds storageKind, 
  59.                 FW_CCloneInfo* cloneInfo);
  60.     FW_CPromise(Environment*ev, 
  61.                 FW_CLinkSource* linkSource,
  62.                 FW_CCloneInfo* cloneInfo);
  63.     virtual ~FW_CPromise();
  64.  
  65. //----------------------------------------------------------------------------------------
  66. //    New API
  67. //
  68. public:
  69.     virtual void        Promise(Environment *ev, 
  70.                                 ODStorageUnit* storageUnit, 
  71.                                 ODPropertyName propertyName, 
  72.                                 ODValueType valueType);
  73.     
  74.     virtual void         FulfillPromise(Environment *ev, 
  75.                                 ODStorageUnitView *promiseSUView, 
  76.                                 ODPropertyName propertyName,
  77.                                 ODValueType valueType, 
  78.                                 FW_CCloneInfo* cloneInfo) = 0;
  79.  
  80.     FW_CFrame*            GetScopeFrame(Environment *ev) const;    
  81.     
  82.     FW_EStorageKinds    GetStorageKind(Environment *ev) const;    
  83.     
  84.     ODUpdateID            GetUpdateID(Environment *ev) const;
  85.     
  86.     ODPropertyName        GetPropertyName(Environment *ev) const;
  87.     ODValueType         GetValueType(Environment *ev) const;
  88.  
  89. //----------------------------------------------------------------------------------------
  90. //    Internal only
  91. //
  92. public:
  93.     long                PrivHandleFulfillPromise(Environment *ev, 
  94.                                 ODStorageUnitView *promiseSUView);
  95.     FW_CLinkSource*        PrivGetLinkSource(Environment *ev) const;
  96.  
  97. //----------------------------------------------------------------------------------------
  98. //    Data members
  99. //
  100. private:
  101.     FW_CFrame*                fScopeFrame;
  102.     FW_EStorageKinds        fStorageKind;
  103.     ODUpdateID                fUpdateID;            // for clipboard promise
  104.     FW_CLinkSource*            fLinkSource;        // for link promise
  105.     FW_Boolean                fPromised;
  106.     FW_CDataInterchange*    fDataInterchange;
  107.     long                    fPromiseCount;
  108. };
  109.  
  110. //----------------------------------------------------------------------------------------
  111. //    FW_CPromise::GetUpdateID
  112. //----------------------------------------------------------------------------------------
  113. inline ODUpdateID FW_CPromise::GetUpdateID(Environment*) const
  114. {
  115.     return fUpdateID;
  116. }
  117.  
  118. //----------------------------------------------------------------------------------------
  119. //    FW_CPromise::GetScopeFrame
  120. //----------------------------------------------------------------------------------------
  121. inline FW_CFrame* FW_CPromise::GetScopeFrame(Environment*) const
  122. {
  123.     return fScopeFrame;
  124. }
  125.  
  126. //----------------------------------------------------------------------------------------
  127. //    FW_CPromise::GetStorageKind
  128. //----------------------------------------------------------------------------------------
  129. inline FW_EStorageKinds FW_CPromise::GetStorageKind(Environment*) const
  130. {
  131.     return fStorageKind;
  132. }
  133.  
  134. //----------------------------------------------------------------------------------------
  135. //    FW_CPromise::PrivGetLinkSource
  136. //----------------------------------------------------------------------------------------
  137. inline FW_CLinkSource* FW_CPromise::PrivGetLinkSource(Environment*) const
  138. {
  139.     FW_ASSERT(fStorageKind == FW_kLinkStorage);
  140.     return fLinkSource;
  141. }
  142.  
  143. #endif